package module16;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;

public class Download_Example {

	/**
	 * @param args
	 */
	public static WebDriver driver;
	public static void main(String[] args) throws Throwable {
		FirefoxProfile prof = new FirefoxProfile();
		prof.setPreference("browser.download.folderList", 2);
		prof.setPreference("browser.download.dir", "C:\\Manjusha");
		prof.setPreference("browser.helperApps.neverAsk.saveToDisk",
		"application/msword,application/x-rar-compressed,application/octet-stream,application/csv,text/csv,application/octet-stream,application/x-msdownload,application/exe,application/x-exe,application/dos-exe,vms/exe,application/x-winexe,application/msdos-windows,application/x-msdos-program");
		
		driver = new FirefoxDriver(prof);
		driver.get("http://messenger.yahoo.com/download/");
		driver.manage().window().maximize();
		driver.findElement(By.xpath("//*[@id='messenger-download']/strong/strong/strong")).click();
		Thread.sleep(7000);
		
		

	}

}
